
#include <iostream>
#include <string.h>
#include <unistd.h>

using namespace std;

class Person {
private:
	char *name;
	int age;
	char *work;
	
public:	
	Person(){ 
		cout <<  "Person()" << endl;
		this->name = NULL;
		this->work = NULL;
	}
	
	~Person()
	{
		cout << "~Person()" <<endl;
		if(this->name){
			cout << "name = " << name <<endl;
			delete this->name;
		}
		if(this->work) {
			cout << "work = " << work <<endl;
			delete this->work;
		}
	}
	
	void printInfo()
	{
		cout << " just a test function "<< endl;
	}
	
};


void test_func()
{
	Person per;
	per.printInfo();

	
	//Person *p = new Person();
	//p->printInfo();
	//delete p;
	

	
	

}

int main(int argc , char **argv)
{			
	int i;
	for(i = 0; i < 2; i++)
		test_func();

	return 0;
}















